home *** CD-ROM | disk | FTP | other *** search
/ Compute! Gazette 1985 October / 1985-10.d64 / farm game (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  11KB  |  321 lines

  1. 10 bo=7:bg=9:ch=1:gosub3100:poke53272,23
  2. 20 clr:gosub3110:fg=0:print"[200]ow long will you manage your farm";
  3. 30 inputqq$:qq=val(qq$):ifqq=0thengosub2930
  4. 40 iffg<>0then20
  5. 50 forzz=1toqq:gosub2110:gosub2150:ifzz=1thengosub2190
  6. 60 bo=7:bg=6:ch=1:gosub3100
  7. 70 print"[147] [217]ear:[146]";zz:print" [208]lanting season selection: [146]
  8. 80 [153][163]5)"f1 key...(NULL)arket news
  9. 90 printtab(5)"f3 key...[217]our financial status
  10. 100 [153][163]5)"f5 key...(NULL)lanting
  11. 110 printtab(5)"f7 key...[211]ell crops on futures
  12. 120 [153][163]8)"(NULL)hat is your selection?
  13. 130 gosub2950
  14. 140 ifasc(a$)<133orasc(a$)>136then130
  15. 150 aa=asc(a$)-132:onaagosub1150,1370,1520,1890
  16. 160 ifaa=3then180
  17. 170 goto60
  18. 180 bo=7:bg=7:ch=6:gosub3100
  19. 190 print"[147]":printtab(10)"[217]our crops are growing.
  20. 200 fx[178]0:[129]j[178]1[164]3:fx[178]fx[170](ts(j)[172][181]((bp(j)[172]fp(j))[172]100[170].5)[173]100):[130]
  21. 210 fx[178][181](fx[172]100[170].5)[173]100:sb[178]0
  22. 220 [129]j[178]1[164]3:sb[178]sr(j)[170]sb:[130]
  23. 230 [129]j[178]1[164]3:sr(j)[178]sr(j)[171]ts(j):[130]
  24. 240 [141]2200:[141]2360
  25. 250 gt[178]0:[129]j[178]1[164]3:gt[178]gt[170](ty(j)[172][181](yp(j)[172]100[170].5)[173]100):[130]
  26. 260 pt[178]0:[129]j[178]1[164]3:pt[178](fu(j)[172]ta(j))[170]pt:[130]:pt[178][181](pt[172]ga[172]100[170].5)[173]100
  27. 270 bo[178]2:bg[178]2:ch[178]1:[141]3100
  28. 280 [153]"load":[153][163]5)"   left$arvest (NULL)ime on the ascarm   wait
  29. 290 gosub3020:print"[195]rop[146]     [211]elling price[146]    [217]ield[146]
  30. 300 [129]j[178]1[164]3:rr[178]ta(j):[139]rr[178]0[167]rr[178]1
  31. 310 tm[178]yp(j):[141]3030:yp$[178]tm$:yp(j)[178][197](tm$)
  32. 320 tm[178]ty(j):[141]3030:ty$[178]tm$:ty(j)[178][197](tm$)
  33. 330 [153]n$(j);[163]13)yp$;[163]33[171][195](ty$))[181](ty(j)):[130]
  34. 340 [153]"right$t is now time to pay your bills and to sell your crops.":[141]3010
  35. 350 [153]"lenurrent peekank peekalance";:tm[178]ba:[141]3030:ba$[178]tm$:ba[178][197](tm$)
  36. 360 [153][163]33[171][195](ba$))ba$
  37. 370 [153]"ascutures lenrop lenheck";:tm[178]fx:[141]3030:fx$[178]tm$:[153][163]33[171][195](fx$))fx$
  38. 380 [153]"(NULL)otal (NULL)ield";:tm[178]gt:[141]3030:gt$[178]tm$:gt[178][197](tm$)
  39. 390 [153][163]33[171][195](gt$))gt$
  40. 400 [153]"(NULL)oan (NULL)ayment str$ue";:tm[178][181]((lo[173]3)[172]100[170].5)[173]100:[141]3030
  41. 410 [153][163]33[171][195](tm$))tm$:lp[178][181]([197](tm$)[172]100[170].5)[173]100
  42. 420 [153]"left$arvesting lenosts";:tm[178]hv:[141]3030:hv$[178]tm$:[153][163]33[171][195](hv$))hv$
  43. 430 hv[178][181]([197](tm$)[172]100[170].5)[173]100
  44. 440 [153]"lenost for 200 atncres";:tm[178][181](ce[172]100[170].5)[173]100[172]200:[141]3030:ce$[178]tm$
  45. 450 [153][163]33[171][195](ce$))ce$
  46. 460 [153]"ascuel valxpense";:tm[178]pt:[141]3030:pt$[178]tm$:pt[178][181]([197](tm$)[172]100[170].5)[173]100
  47. 470 [153][163]33[171][195](pt$))pt$
  48. 480 [153]"(NULL)verhead valxpense";:tm[178]ov:[141]3030:ov$[178]tm$:[153][163]33[171][195](ov$))ov$
  49. 490 ov[178][181]([197](tm$)[172]100[170].5)[173]100
  50. 500 [153]"lenrop (NULL)torage ascees";:tm[178](12[172]sb[172]0.015):[141]3030:sb$[178]tm$
  51. 510 sb[178][181]([197](tm$)[172]100[170].5)[173]100
  52. 520 [153][163]33[171][195](sb$))sb$:[141]3010
  53. 530 [153]"(NULL)otal atnssets=wait";:tm[178]ba[170]fx[170]gt:[141]3030:aa$[178]tm$
  54. 540 [153][163]33[171][195](aa$))aa$
  55. 550 [153]"(NULL)otal str$ebits=wait";
  56. 560 tm[178]lp[170]hv[170]ov[170]pt[170]sb[170](ce[172]200):[141]3030:dt$[178]tm$:dt[178][197](tm$)
  57. 570 [153][163]33[171][195](dt$))dt$:[141]2940
  58. 580 [129]j[178]1[164]3:[139]ty(j)[178]0[167]730
  59. 590 [153]"loadleft$ow many bushels of ";n$(j);" do you wish":[153]"to sell?
  60. 600 print"[217]ou have a maximum of ";ty(j);" to sell.
  61. 610 fg[178]0:x$[178]"":[133]x$:[139]x$[178]""[167]590
  62. 620 x[178][197](x$)
  63. 630 [139]x[177]ty(j)[167][153]"(NULL)ou don't have ";x;"bushels!":[141]3000:[137]590
  64. 640 [153]x;"bushels of ";n$(j);" would sell":[153]"for $";:tm[178]x[172]yp(j):[141]3030
  65. 650 [153]tm$:[141]3020
  66. 660 [153]"right$s ";x;"bushels of ";n$(j);" okay?
  67. 670 print"[208]ress f1[146] to change, f3[146] to sell
  68. 680 [141]2950
  69. 690 [139]a$[178][199](133)[167]590
  70. 700 [139]a$[179][177][199](134)[167]680
  71. 710 ba[178]ba[170]([181](x[172]yp(j)[172]100[170].5)[173]100)
  72. 720 sr(j)[178][181](ty(j)[171]x[170]sr(j))
  73. 730 [130]
  74. 740 ba[178][181]((ba[170]fx)[172]100[170].5)[173]100
  75. 750 [139]lo[178]0[167]850
  76. 760 [153]"loadleft$ow much of your loan do you
  77. 770 print"wish to pay off?  [205]inimum payment
  78. 780 [153]"is $";:tm[178][181]((lo[173]3)[172]100[170].5)[173]100:[141]3030:[153]tm$
  79. 790 [153]"(NULL)ou owe a total of $";:lo[178][181](lo[172]100[170].5)[173]100:[153]lo
  80. 800 fg[178]0:[133]a
  81. 810 [139]a[179]tm[167][137]760
  82. 820 [139]a[177]lo[167]a[178]lo
  83. 830 ba[178][181]((ba[171]a)[172]100[170].5)[173]100:lo[178](lo[171]a)[172]1.12::lo[178][181](lo[172]100[170].5)[173]100
  84. 840 [139]lo[179]0[167]lo[178]0
  85. 850 ba[178]ba[171][181](ce[172]200[172]100[170].5)[173]100
  86. 860 ba[178]ba[171][181](ov[172]100[170].5)[173]100
  87. 870 ba[178]ba[171][181](hv[172]100[170].5)[173]100
  88. 880 ba[178]ba[171][181](pt[172]100[170].5)[173]100
  89. 890 ba[178]ba[171][181](sb[172]100[170].5)[173]100
  90. 900 [139]ba[179]0[167][141]2620
  91. 910 [129]j[178]1[164]3:ty(j)[178]0:[130]
  92. 920 [129]j[178]1[164]3:ts(j)[178]0:[130]:[130]
  93. 930 [153]"load":[153][163]5)"    valnd of chr$ame (NULL)ally   wait
  94. 940 print"[195]urrent [194]ank [194]alance = $";:tm=ba:gosub3030:printtm$:ba=val(tm$)
  95. 950 gosub3010
  96. 960 print"[195]rops in [211]torage:
  97. 970 [153]" lenrop wait  peekushels in (NULL)torage wait
  98. 980 xx=0
  99. 990 forj=1to3:ifsr(j)<0thensr(j)=0
  100. 1000 printn$(j);:tm=sr(j):gosub3030
  101. 1010 printtab(22-len(tm$));int(sr(j)):xx=xx+sr(j)*yp(j):next
  102. 1020 print"[211]tored crop cash value:";:tm=xx:gosub3030
  103. 1030 printtab(35-len(tm$));"$"tm$:xx=val(tm$):ba=ba+xx
  104. 1040 print"[193]mount owed to [194]ank:";:tm=lo:gosub3030:printtab(35-len(tm$));"$"tm$
  105. 1050 lo=val(tm$):ba=ba-int(lo*100+.5)/100
  106. 1060 ifba>=20000thenzz=1
  107. 1070 ifba<20000thenzz=2
  108. 1080 print"[199]rand [212]otal in [194]ank:";:tm=ba:gosub3030:ba=val(tm$)
  109. 1090 printtab(35-len(tm$));"$"tm$:print
  110. 1100 onzzgosub2780,2820
  111. 1110 print"[215]ould you like to try again?
  112. 1120 [141]2950:[139]a$[178]"y"[167]10
  113. 1130 [139]a$[179][177]"n"[167]1120
  114. 1140 [128]
  115. 1150 [153]"load":bo[178]1:bg[178]1:ch[178]0:[141]3100
  116. 1160 [153][163]8)"      (NULL)val(NULL)(NULL) (NULL)val(NULL)valatn(NULL)val     ":[141]3020
  117. 1170 ir$[178][196]([181]((ir[171]1)[172]100))
  118. 1180 [153]"(NULL)early right$nflation (NULL)ate: ";[163]33)ir$;"%
  119. 1190 tm=ga:gosub3030:ga$=tm$:ga=val(tm$)
  120. 1200 print"[198]uel cost (per gallon) :";tab(33-p)"$"ga$
  121. 1210 tm=hs:gosub3030:hs$=tm$:hs=val(tm$)
  122. 1220 print"[200]erbicide cost per unit:";tab(33-p)"$"hs$
  123. 1230 tm=is:gosub3030:is$=tm$:is=val(tm$)
  124. 1240 print"[201]nsecticide cost per unit:";tab(33-p)"$"is$
  125. 1250 tm=ov:gosub3030:ov$=tm$:ov=val(tm$)
  126. 1260 print"[207]verhead costs:";tab(33-p)"$"ov$
  127. 1270 tm=ce:gosub3030:ce$=tm$
  128. 1280 print"[195]ost per acre:";tab(33-p)"$"ce$:gosub3010
  129. 1290 printtab(13)"  [211]eed prices
  130. 1300 [153]"chr$rain seed cost per bushel
  131. 1310 forj=1to3:printn$(j);":";:tm=bs(j):gosub3030:bs(j)=val(tm$)
  132. 1320 printtab(33-p)"$"tm$:next:print:gosub3010
  133. 1330 printtab(10)" [198]utures [205]arket [208]rice ":print
  134. 1340 forj=1to3:printn$(j);":";:tm=bp(j)*fp(j):gosub3030
  135. 1350 printtab(33-p)"$"tm$:next:print
  136. 1360 gosub2940:return
  137. 1370 bo=2:bg=0:ch=1:gosub3100
  138. 1380 print"[147]    [217]our [198]inancial [211]tatus  ":gosub3010
  139. 1390 tm=ba:gosub3030:ba=val(tm$)
  140. 1400 print"[211]avings [193]ccount [194]alance:";tab(25-p)"$"ba
  141. 1410 tm=lo:gosub3030:lo=val(tm$)
  142. 1420 print"[217]ou owe the bank:";
  143. 1430 iflo=0thenprinttab(28)"------":goto1450
  144. 1440 printtab(25-p)"$"tm$
  145. 1450 print"":gosub3010:print"        [195]rops presently in storage ":print:x=0
  146. 1460 printtab(9)"[195]rop";tab(20)"[194]ushels
  147. 1470 [129]j[178]1[164]3:[139]sr(j)[179]1.0[167]sr(j)[178]0
  148. 1480 [153][163]8)n$(j);[163]22)sr(j):x[178]x[170]sr(j):[130]
  149. 1490 [153]"chr$rain (NULL)torage ascee: $";:tm[178][181](x[172].015):[141]3030
  150. 1500 [153]tm$" per month.
  151. 1510 gosub2940:return
  152. 1520 bo=5:bg=5:ch=1:gosub3100
  153. 1530 print"[147]";tab(5)"  [208]lanting [212]ime [207]n the [198]arm  
  154. 1540 [153]"(NULL)ou have 200 acres to plant,divided into";
  155. 1550 [153]"5 fields of 40 acres each.
  156. 1560 print"[198]ields 1-3 are average or s